# demo03_write.py  write/writelines
fw1 = open("/opt/tc.txt", mode="w")
fw1.writelines(["hello\n","world\n","hehe\n"])
fw1.close()
# ===================================
# w: 覆盖写，覆盖的是一次open操作
fw = open("/opt/dc.txt", mode="w") # w:write
fw.write("123\n")
fw.write("456~\n")
fw.close()